/**
 * @author yinyunqi
 * @datetime 2018年3月13日
 * @Content 
 */
package com.zcl.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {
	
	/**
	 * 指向登录页面
	 */
	@RequestMapping("/loginPage")
	public String login() {
		return "login";
	}
	
	/**
	 * 处理登录成功
	 */
	@RequestMapping("/loginSuccess")
	public String loginSuccess() {
		System.out.println("loginSuccess");
		return "index";
	}
	
	/**
	 * 指向登录失败页面
	 */
	@RequestMapping("/loginFailure")
	public String loginFailure() {
		System.out.println("loginFailure");
		return "loginFailure";
	}
	
	/**
	 * 处理退出登录
	 */
	@RequestMapping("/logout")
	public String logout() {
		return "login";
	}
	
	/**
	 * 处理登录请求
	 */
	@RequestMapping("/login")
	public void login(HttpServletRequest request) {
		String userName = request.getParameter("userName");
		String password = request.getParameter("password");
		System.out.println(userName+"----------"+password);
	}
}
